
#include        <stdlib.h>
#include        "bistromathique.h"

int             my_tablen(char **tab)
{
  int   i;

  i = 0;
  while (tab[i])
    i++;
  return (i);
}

int             *my_int_malloc(int **itab, char *str, int k, char **tab)
{
  *itab = malloc(sizeof(*itab) * (my_tablen(tab) - count_oper(str)) + 1);
  if (*itab == NULL)
    return (NULL);
  return (*itab);
}

int             *tab_to_itab(char **tab, char *str)
{
  int           i;
  int           j;
  int           k;
  int           *itab;

  i = 0;
  j = 0;
  k = 0;
  itab = my_int_malloc(&itab, str, k, tab);
  while (tab[i] != '\0')
    {
      if (is_num(tab[i][0]) != 0)
	itab[k++] = my_getnbr(tab[i]);
      i++;
    }
  itab[k++] = '\0';
  return (itab);
}


